package com.home.demo.controller;

import com.home.demo.common.R;
import com.home.demo.entity.dto.menuAndRole.MenuAndRoleDTO;
import com.home.demo.service.MenuAndRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 
 * 菜单角色关联Controller
 */
@RestController
@RequestMapping("/menuAndRole")
public class MenuAndRoleController {
    @Autowired
    private MenuAndRoleService menuAndRoleService;


    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody MenuAndRoleDTO menuAndRoleDTO){
		menuAndRoleService.saveInfo(menuAndRoleDTO);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody MenuAndRoleDTO menuAndRoleDTO){
		menuAndRoleService.removeInfoByIds(menuAndRoleDTO);

        return R.ok();
    }

}
